<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Mustache 模板插值</title>
</head>
<body>
<div id="app">
    <h1>{{ info }}</h1>
    <h1>{{i}}</h1>
    <h1>{{i+j}}</h1>
    <h1>{{ info.toUpperCase() }}</h1>
    <h1>{{ p }}</h1>
    <h1>{{ obj }}</h1>

</div>
<script type="module">
    // 导入所需函数
    import {createApp, ref, reactive} from "../../../js/vue.esm-browser.js"

    // 创建 vue 对象
    let app = createApp(
        {
            setup() {
                let info = "Hello, World!"
                let i = 123;
                let j = 4;
                let p = ref(789);
                let obj = reactive({
                    name: "abc",
                    gender: "男",
                    age: 18
                });
                return {
                    info,
                    i,
                    j,
                    p,
                    obj
                }
            }
        }
    )

    // 将 vue 对象和 html 进行关联
    app.mount("#app")

</script>
</body>
</html>